<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #box {
            margin: 100px auto;
            text-align: center;
            border: 1px solid #ccc;
            width: 400px;
        }

        #box>div {
            margin: 20px;
        }
    </style>
</head>

<body>
    <div id="box">
        <div>
            概要<input type="text" value="这是概要" id="summary">
        </div>
        <div>
            内容<input type="text" value="这是内容" id="content">
        </div>
        <div>
            规则<input type="text" placeholder="aaa,bbb" value="aaa" id="ruleId">
        </div>
        <div>
            <button id="sendBtn">发送</button>
        </div>
        <div>
            结果：<span id="result"></span>
        </div>
    </div>
    <script src="https://static.ycgame.com/packages/jquery/1.12.3/jquery.min.js"></script>
    <script>
        function sendFn() {
            $("#result").html("添加中...")
            var summary = $("#summary").val();
            var content = $("#content").val();
            var ruleId = $("#ruleId").val();
            var param = { summary: summary, content: content, ruleId: ruleId };
            $.ajax({
                url: "http://local.fancyalarm.com/index.php?q=api_addRecord",
                type: "get", dataType: "json", data: param,
                success: function (res) {
                    if (res.result == 0) {
                        $("#result").html("添加成功")
                    }
                    console.log(res);
                }
            })
        }
        $("#sendBtn").click(function () {
            sendFn();
        })
    </script>
</body>

</html>